/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package plash.display;

import plash.geom.Rectangle;

/**
 *
 * @author  #0K Srinivasan <hashok.com>
 */
public class Box extends DisplayObjectContainer
{
    private Rectangle _definition = new Rectangle(0, 0, 50, 50);
    private int _color;
    
    public Box()
    {
        this(100,100, 0x000000);
    }
    
    public Box(int width, int height, int color)
    {
        super();
        _color = color;
        _definition.setWidth(width);
        _definition.setHeight(height);
        _updateDrawing();
    }
    
    private void _updateDrawing()
    {
        Graphics g = this.__graphics;
        
        g.clear();
        g.setLineStyle(10, _color, 1.0f);
        g.beginFill(_color, 1.0f);
        g.drawRectangle(_definition);
        g.endFill();        
    }

    public Rectangle getDefinition()
    {
        return _definition;
    }

    public void setDefinition(Rectangle _definition)
    {
        this._definition = _definition;
        _updateDrawing();
    }   
}
